import java.util.Scanner;

public class Main {

    public String isWin;

    public static void main(String[] args) {
        Main main = new Main();
        // write your code here
        System.out.println("开始游戏请按0");
        NGuessNumber nGuessNumber = new NGuessNumber();
        Scanner input = new Scanner(System.in);
        int luru = input.nextInt();
        while (luru == 0) {
            main.isWin = String.valueOf(nGuessNumber.compareGuessAnswer());
            if (main.isWin.equals("true")){
                System.out.println("恭喜你获胜！");
            }else if(main.isWin.equals("false")){
                System.out.println("很遗憾你失败了！");
            }
            System.out.println("是否继续游戏，继续请按0，结束请按1");
            int tuichu = input.nextInt();
            if (tuichu == 1) {
                break;
            }
        }

    }

}
